home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d21 / dvmam11.arc / DVMAM.DOC < prev    next >
Text File  |  1990-11-24  |  36KB  |  925 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.  
  12.  
  13.  
  14.  
  15.  
  16.  
  17.  
  18.  
  19.  
  20.  
  21.  
  22.  
  23.  
  24.  
  25.  
  26.  
  27.  
  28.  
  29.  
  30.  
  31.  
  32.                       Dynamic-Virtual Memory Allocation Manager (tm)
  33.                                         DVMAM (tm)
  34.                                        Version 1.10
  35.                             Copyright 1990 R.C.B. Enterprises
  36.                                      Turbo C version
  37.                                     October 8th, 1990
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72.  
  73.                                   Table of contents
  74.                                   -----------------
  75.                                                                  Page
  76.  
  77.      What is Shareware.......................................... 1
  78.      Disclaimer of warranty..................................... 1,2
  79.      Trademarks................................................. 2
  80.      What should I have received with DVMAM?.................... 2
  81.      So then, what is DVMAM?.................................... 2
  82.      How does DVMAM function?................................... 3
  83.      So what are the memory limits?............................. 3,4
  84.  
  85.      Important considerations for memory allocation............. 4,5
  86.        A. Extended memory....................................... 4
  87.        B. Expanded memory....................................... 5
  88.  
  89.      What are the functions that I can use in my system?........ 5-9
  90.        A. Extended memory functions............................. 5,6
  91.          I.    alloc_ext........................................ 5
  92.          II.   dealloc_ext...................................... 5
  93.          III.  save_ext......................................... 5
  94.          IV.   load_ext......................................... 5,6
  95.          V.    kbytes_ext....................................... 6
  96.          VI.   ext_free......................................... 6
  97.          VII.  cpu_type......................................... 6
  98.          VIII. ext_setup........................................ 6
  99.  
  100.        B. Expanded memory functions............................. 6,7
  101.          I.    alloc_ems........................................ 6
  102.          II.   dealloc_ems...................................... 6
  103.          III.  save_ems......................................... 7
  104.          IV.   load_ems......................................... 7
  105.          V.    pages_ems........................................ 7
  106.          VI.   ems_installed.................................... 7
  107.  
  108.        C. DVMAM controller functions............................ 7-9
  109.          I.    alloc_mem........................................ 7
  110.          II.   dealloc_mem...................................... 7,8
  111.          III.  save_memory...................................... 8
  112.          IV.   load_memory...................................... 8
  113.          V.    bytes_available.................................. 8
  114.          VI.   bytes_total...................................... 8
  115.          VII.  set_memory_usage................................. 8,9
  116.          VIII. memory_setup..................................... 9
  117.          IX.   memory_shutdown.................................. 9
  118.  
  119.      How do I link the DVMAM library into my program?........... 9,10
  120.        A. TURBO C projects...................................... 9
  121.        B. TURBO C command-line compiler......................... 9,10
  122.        C. TLINK................................................. 10
  123.  
  124.      Thanks..................................................... 11
  125.      Version 1.10 release....................................... 11
  126.      Registration form.......................................... 12 (unlabeled)
  127.  
  128.                                           I
  129.  
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.  
  137.  
  138.  
  139.                                    What is Shareware?
  140.                                    ------------------
  141.  
  142.           Shareware distribution gives users a chance to try software before
  143.      purchasing it. If you try a Shareware program and continue using it, you
  144.      are expected to register that program. Individual programs differ on the
  145.      details. Some programs request registration while others require it and
  146.      others allow an optional maximum trial period that the program may be
  147.      freely used before registration is required. With the registration you may
  148.      receive only the right to continue to use that product to a full blown
  149.      version of the program with printed manual and source code.
  150.  
  151.           Copyright laws apply both to Shareware and commercial software and the
  152.      copyright holder retains all rights with a few specific exceptions stated
  153.      below. Shareware authors are accomplished programmers just like commercial
  154.      authors and the programs are of comparable quality. (In both cases there
  155.      are good programs and bad programs.) The main difference is in the method
  156.      of distribution. The author specifically grants the right to copy and
  157.      distribute the software either to all or a specific group. For example,
  158.      some authors require written permission before a commercial disk vendor may
  159.      copy their software.
  160.  
  161.           Shareware is a distribution method, not a type of software. You should
  162.      find software that suits your needs and pocketbook whether it's commercial
  163.      or Shareware. The Shareware system makes fitting your needs easier because
  164.      you can try the software before you purchase the software. And because the
  165.      overhead of producing the program is low, prices are also low (in most
  166.      cases). Shareware has the ultimate money-back guarantee.. If you don't use
  167.      the product, don't pay for it.
  168.  
  169.                                  Disclaimer of Warranty
  170.                                  ----------------------
  171.  
  172.           The DVMAM program and manual are sold "as is" and without warranties
  173.      as to performance of merchantability or any other warranties whether
  174.      expressed or implied. Because of the various hardware and software
  175.      environments into which the program may be put, no warranty of fitness for
  176.      a particular purpose is offered. The user must assume the entire risk of
  177.      using the program. Any liability of the seller will be limited exclusively
  178.      to product replacement or refund of purchase price. R.C.B. Enterprises
  179.      assumes no liability for damages, direct or consequential, which may result
  180.      from the use of DVMAM.
  181.  
  182.           DVMAM is a Shareware program and is provided at no charge to the user
  183.      for evaluation. Feel free to share it with your friends provided it is not
  184.      altered or as part of another system. If you find DVMAM useful and continue
  185.      to use DVMAM after a 30 day trial period, a registration payment of $35 is
  186.      required. The $35 registration fee will license one copy for use on any one
  187.      computer at a time.
  188.  
  189.  
  190.           Anyone distributing DVMAM for any kind of remuneration must first
  191.      contact R.C.B. Enterprises for authorization.
  192.  
  193.  
  194.                                        Page 1
  195.  
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202.  
  203.  
  204.  
  205.           You are encouraged to pass a copy of DVMAM along to your friends for
  206.      evaluation. Please encourage them to register their copy if they find that
  207.      they can use it. All registered users will receive the latest copy of DVMAM
  208.      in all memory models supported by the requested compiler version, the
  209.      ability to access all available memory (if you're a Turbo Pascal user), and
  210.      a bound printed manual.
  211.  
  212.           Compilers currently supported as of this release are Turbo Pascal 4.0
  213.      thru 5.5, Turbo C 2.0 and Microsoft C 5.0 and higher. The registration fee
  214.      of $35 is the same for all versions of DVMAM. The source (Assembler and C
  215.      for TURBO C and Microsoft C, Assembler and Pascal for TURBO PASCAL) is
  216.      available with DVMAM for $50 (this includes the source and the latest
  217.      release of DVMAM). Please remember to specify compiler when you register.
  218.  
  219.                                        Trademarks
  220.                                        ----------
  221.  
  222.         Before we continue, we need to cover trademarks so the appropriate
  223.      companies receive credit.
  224.  
  225.           Microsoft is a registered trademark of Microsoft corporation
  226.           IBM is a trademark of International Business Machines
  227.           TURBO Pascal and TURBO C are trademarks of Borland International
  228.           Dynamic-Virtual Memory Allocation Manager and DVMAM are trademarks of
  229.              R.C.B. Enterprises
  230.           LIM is a trademark of Lotus-Intel-Microsoft corporations
  231.  
  232.                         What should I have received with DVMAM?
  233.                         ---------------------------------------
  234.  
  235.           With the Shareware version of DVMAM you should have received the
  236.      following files:
  237.  
  238.           DVMAM.DOC      - This is this file
  239.           DVMAMSTC.LIB   - Library containing the small model for Turbo C
  240.           DVMAM.H        - Turbo C include file
  241.           DV_TEST.C      - A test program that shows memory allocation in action
  242.           DV_REG.TXT     - A simple registration form for DVMAM. This form is
  243.                            also found at the end of this document.
  244.           DV_BUG.TXT     - A bug report form for DVMAM - hopefully this will
  245.                            never be used.
  246.           DV_PRINT.BAT   - A small batch file that prints this file.
  247.           README.1ST     - A small file describing DV_PRINT and also contains a
  248.                            list of these files.
  249.  
  250.                                 So then, what is DVMAM?
  251.                                 -----------------------
  252.  
  253.           The Dynamic-Virtual Memory Allocation Manager uses conventional,
  254.      extended and expanded memory in your computer to allow your programs to
  255.      access up to 24 megabytes of memory. This memory, which on most systems is
  256.      used only for RAM disks or print spoolers, can now be used effectively for
  257.      any application as though it was conventional memory by using the DVMAM
  258.      system.
  259.  
  260.                                        Page 2
  261.  
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268.  
  269.  
  270.  
  271.                                 How does DVMAM function?
  272.                                 ------------------------
  273.  
  274.           DVMAM uses a main set of generalized functions to control specific
  275.      functions focused at specific memory types. DVMAM is capable of allocating
  276.      memory to a specific memory type or over all memory available in the system
  277.      your program is being executed in.
  278.  
  279.           Once memory has been allocated (reserved for future use), its
  280.      information is stored in memory to be used by DVMAM in the future and a
  281.      block identification number is returned to the user. This number must be
  282.      saved in order to use the memory just allocated. The maximum amount of
  283.      space that can be allocated to one block is 64k bytes (or 65536 bytes).
  284.  
  285.           In order to use this memory a data transfer area is established by
  286.      DVMAM to operate as a medium between the normal C functions and DVMAM.
  287.      dvmam_dta is declared as a far pointer by DVMAM and serves as this transfer
  288.      area. A specific amount of memory is reserved for dvmam_dta when DVMAM is
  289.      initialized with a function called "memory_setup". The amount of memory
  290.      reserved for dvmam_dta is specified by the user and should be no larger
  291.      than the largest block you intend to allocate. If it is larger, precious
  292.      bytes will be reserved and never used. As with the largest possible block
  293.      size being 64k, the largest size of dvmam_dta is also 64k.
  294.  
  295.           Once dvmam_dta has been set, the contents stored in the memory
  296.      location used by dvmam_dta may be saved with a function called
  297.      "save_memory". The block identification number is passed to the function
  298.      and the appropriate memory type, size and location is determined. The
  299.      contents of dvmam_dta is then transferred into that location.
  300.  
  301.           Similar to the function above that saves information, "load_memory"
  302.      will load data in from a specific memory location into dvmam_dta. NOTE:
  303.      DVMAM does not check to see if the contents of DVMAM have been changed and
  304.      not saved. Once a call to "load_memory" has been made the data in dvmam_dta
  305.      will be destroyed as new data replaces it.
  306.  
  307.                              So what are the memory limits?
  308.                              ------------------------------
  309.  
  310.           Each memory type has specific limits. Conventional memory is available
  311.      on all machines. The amount of memory that may be used is dependent on the
  312.      size of the programs loaded into memory. So naturally a program occupying
  313.      128k of memory will leave more available than a program occupying 384k of
  314.      memory. The limit on conventional memory is 640k and all programs executed
  315.      will take up some or all of conventional memory. With new innovations in
  316.      computing, more and more specialized drivers and TSR (Terminate-Stay
  317.      Resident) programs are storing the majority of their information in
  318.      extended memory and freeing more conventional memory to be used by larger,
  319.      more memory intensive programs. This is important in many cases because the
  320.      majority of programs currently do not support either extended or expanded
  321.      memory.
  322.  
  323.           LIM EMS (expanded memory) supports up to 8 megabytes of memory. This
  324.  
  325.  
  326.                                        Page 3
  327.  
  328.  
  329.  
  330.  
  331.  
  332.  
  333.  
  334.  
  335.  
  336.  
  337.      memory is governed throughout the system by a driver known as an EMM driver
  338.      (Expanded Memory Manager). The EMM keeps track of memory that has been
  339.      allocated and that which hasn't. Since the EMM uses a separate external
  340.      driver, other programs are able to allocate expanded memory and not
  341.      interfere with each other. DVMAM, before attempting to allocate expanded
  342.      memory, first checks to see if the EMM has been installed.
  343.  
  344.           If an EMM has not been installed, DVMAM will make no attempt to
  345.      allocate expanded memory. This is done at run-time, not during link time,
  346.      so a program that supports expanded memory will make use of it when it is
  347.      available. DVMAM requires an EMM that supports the LIM EMS standard version
  348.      3.2 or higher.
  349.  
  350.           Extended memory is memory directly supported by the microprocessor and
  351.      supports up to 16 more megabytes of memory. Only 80286 machines and their
  352.      successors (such as the 80386 and 80486) support extended memory. Machines
  353.      such as 8086 and 8088 do not support extended memory. DVMAM, before
  354.      attempting to allocate extended memory, first checks the microprocessor
  355.      type.
  356.  
  357.         If a '286 or higher is not in use, DVMAM will make no attempt to
  358.      allocate extended memory. This action, as with checking for the EMM, is
  359.      done at run-type and not link time. A program that supports extended memory
  360.      will only make use of it when it is available.
  361.  
  362.                      Important considerations for memory allocation
  363.                      ----------------------------------------------
  364.  
  365.      Extended memory
  366.      ---------------
  367.  
  368.           There is no way to tell if another program is using extended memory so
  369.      its usage should be optional unless it is run in a single program
  370.      environment. In other words, if extended memory is available and it is
  371.      known that no other programs are making use of extended memory, it is
  372.      entirely safe to use. However, if other programs (such as RAM disks, print
  373.      spoolers or disk cache programs) are running in the system along with the
  374.      main application, data allocated to your program will more than likely
  375.      destroy data in extended memory being used by those sorts of programs. So
  376.      making extended memory optional is advised.
  377.  
  378.           If you are considering an interrupt intensive program (such as
  379.      networking, communications or other programs that make heavy use of
  380.      interrupts or are dependant on interrupts), extended memory should be
  381.      avoided.
  382.  
  383.           Each time data is moved to or from extended memory, interrupt
  384.      processing is halted. A few examples of the effects of extensive extended
  385.      memory moves are: 1. If characters are coming in through your serial port,
  386.      or through a network interface, during an extended memory move those
  387.      characters will be lost. 2. Characters typed at the keyboard may be skipped
  388.      during a move. 3. If usage is extensive enough, one or more seconds may be
  389.      lost by the system clock.
  390.  
  391.  
  392.                                        Page 4
  393.  
  394.  
  395.  
  396.  
  397.  
  398.  
  399.  
  400.  
  401.  
  402.  
  403.      Expanded memory (EMS)
  404.      ---------------------
  405.  
  406.           If expanded memory is in use it must be noted that the EMM will
  407.      allocate 16k chunks. It is important to consider this when allocating
  408.      expanded memory. If only 4k is needed and 256k of expanded memory is
  409.      available, under normal circumstances it would be appropriate to assume
  410.      that 64 blocks of memory could be allocated. Since 16k blocks are allocated
  411.      at a time, only 16 blocks would be used and 12k of memory per block would
  412.      be wasted.
  413.  
  414.           Expanded memory is also different from the other types of memory in
  415.      that it uses a separate, external driver to control the expanded memory.
  416.      Memory allocated to the EMM is kept allocated and assumed it is still in
  417.      use by your program long after your program may have finished executing.
  418.      This makes it unavailable for use by other programs in the future that may
  419.      make use of expanded memory. It is then extremely important to deallocate
  420.      all expanded memory before terminating your program.
  421.  
  422.                   What are the functions that I can use in my system?
  423.                   ---------------------------------------------------
  424.  
  425.      Extended memory functions
  426.      -------------------------
  427.  
  428.           The extended memory functions control all extended memory available in
  429.      the system.
  430.  
  431.         Function name: alloc_ext
  432.         Prototype:     int alloc_ext(int size);
  433.  
  434.         Use:           alloc_ext attempts to allocate memory of <size> bytes.
  435.                        alloc_ext returns the handle of the memory allocated or
  436.                        -1 if the attempt to allocate memory failed.
  437.  
  438.         Function name: dealloc_ext
  439.         Prototype:     int dealloc_ext(int handle);
  440.  
  441.         Use:           dealloc_ext frees the memory specified by the block
  442.                        identifier. Be deallocating memory, it is once again made
  443.                        available and can be allocated again later in the
  444.                        program. dealloc_ext returns 0 on success, -1 on failure.
  445.  
  446.         Function name: save_ext
  447.         Prototype:     int save_ext(int handle, void far * buffer);
  448.  
  449.         Use:           save_ext moves data from the location specified by buffer
  450.                        into the memory location specified by handle. save_ext
  451.                        returns 0 on success, -1 on failure.
  452.  
  453.  
  454.         Function name: load_ext
  455.         Prototype:     int load_ext(int handle, void far * buffer);
  456.  
  457.  
  458.                                        Page 5
  459.  
  460.  
  461.  
  462.  
  463.  
  464.  
  465.  
  466.  
  467.  
  468.  
  469.         Use:           load_ext moves data from the memory location specified by
  470.                        handle into the location at buffer. load_ext returns 0
  471.                        on success, -1 on failure.
  472.  
  473.         Function name: kbytes_ext
  474.         Prototype:     int kbytes_ext(void);
  475.  
  476.         Use:           kbytes_ext returns the total amount of memory (in kbytes)
  477.                        available as extended memory.
  478.  
  479.         Function name: ext_free
  480.         Prototype:     long ext_free(void);
  481.  
  482.         Use:           ext_free returns the amount of extended memory in bytes
  483.                        available to be allocated.
  484.  
  485.         Function name: cpu_type
  486.         Prototype:     int cpu_type(void);
  487.  
  488.         Use:           cpu_type returns the type of microprocessor available on
  489.                        the system DVMAM is currently being used on. Possible
  490.                        return types are: 86 for 8086 and 8088 systems, 186 for
  491.                        80186, 286 for 80286 and 386 for 80386 systems.
  492.  
  493.         Function name: ext_setup
  494.         Prototype:     void ext_setup(void);
  495.  
  496.         Use:           ext_setup prepares all structures and data used by DVMAM
  497.                        for extended memory allocation.
  498.  
  499.      Expanded memory functions
  500.      -------------------------
  501.  
  502.           The expanded memory functions control all expanded memory available in
  503.      the system.
  504.  
  505.         Function name: alloc_ems
  506.         Prototype:     int alloc_ems(int size);
  507.  
  508.         Use:           alloc_ems attempts to allocate expanded memory via the
  509.                        EMM. alloc_ems returns the handle to expanded memory,
  510.                        -1 the attempt to allocate memory failed.
  511.  
  512.         Function name: dealloc_ems
  513.         Prototype:     int dealloc_ems(int handle);
  514.  
  515.         Use:           dealloc_ems frees the memory specified by handle via the
  516.                        EMM. This memory is then made available for use later in
  517.                        program execution or by other programs which may use
  518.                        expanded memory. dealloc_ems returns a 0 if the memory
  519.                        has been successfully deallocated, -1 if the function
  520.                        failed.
  521.  
  522.  
  523.  
  524.                                        Page 6
  525.  
  526.  
  527.  
  528.  
  529.  
  530.  
  531.  
  532.  
  533.  
  534.  
  535.         Function name: save_ems
  536.         Prototype:     int save_ems(int handle, void far * buffer,
  537.                                     unsigned int size);
  538.  
  539.         Use:           save_ems moves data from the memory location specified by
  540.                        buffer into the expanded memory location specified by
  541.                        handle. save_ems returns 0 upon a successful memory move,
  542.                        -1 if the attempt to move data failed.
  543.  
  544.         Function name: load_ems
  545.         Prototype:     int load_ems(int handle, void far * buffer,
  546.                                     unsigned int size);
  547.  
  548.         Use:           load_ems moves data from the memory location specified by
  549.                        handle into buffer. load_ems returns 0 upon a successful
  550.                        memory move, -1 if the attempt to move data failed.
  551.  
  552.         Function name: pages_ems
  553.         Prototype:     int pages_ems(int mode);
  554.  
  555.         Use:           pages_ems returns either the total number of pages in
  556.                        expanded memory or the number of pages available to be
  557.                        allocated. Each page is 16k bytes long. The number of
  558.                        pages returned by pages_ems is determined by mode. A
  559.                        value of 0 will return pages available and a value of 1
  560.                        will return the total number of pages in expanded memory.
  561.                        pages_ems will return -1 if the function failed.
  562.  
  563.         Function name: ems_installed
  564.         Prototype:     int emm_installed(void);
  565.  
  566.         Use:           emm_installed checks to see if the EMM has been installed
  567.                        in memory. If the EMM has been located a value of 1 will
  568.                        be returned, otherwise a value of 0 is returned.
  569.  
  570.      DVMAM controller functions
  571.      --------------------------
  572.  
  573.           These are the main functions used by DVMAM. DVMAM keeps track of all
  574.      the information required for use of the above functions. This information
  575.      includes handles, sizes and pointers. This makes allocation easier on the
  576.      programmer because all use of extended, expanded and conventional memory is
  577.      done by DVMAM.
  578.  
  579.         Function name: alloc_mem
  580.         Prototype:     int alloc_mem(int size);
  581.  
  582.         Use:           alloc_mem checks for memory available and attempts to
  583.                        allocate to that memory. If the allocation is successful,
  584.                        a block identification number is returned, otherwise -1
  585.                        will be returned to alloc_mem.
  586.  
  587.         Function name: dealloc_mem
  588.         Prototype:     int dealloc_mem(int block);
  589.  
  590.  
  591.  
  592.  
  593.  
  594.  
  595.  
  596.  
  597.  
  598.  
  599.  
  600.  
  601.                                        Page 7
  602.  
  603.         Use:           dealloc_mem attempts to deallocate memory allocated with
  604.                        alloc_mem. This will make it available for use elsewhere
  605.                        in your program. dealloc_mem returns 0 upon successful
  606.                        deallocation, -1 if the deallocation attempt failed.
  607.  
  608.         Function name: save_memory
  609.         Prototype:     int save_memory(int block);
  610.  
  611.         Use:           save_memory moves the data located in dvmam_dta into the
  612.                        memory location and type specified by the block
  613.                        identification number returned by alloc_mem. save_memory
  614.                        returns 0 if the attempted move was successful, -1 if
  615.                        the attempted move failed.
  616.  
  617.         Function name: load_memory
  618.         Prototype:     int load_memory(int block);
  619.  
  620.         Use:           load_memory moves data from the memory location and type
  621.                        specified by the block identification number into
  622.                        dvmam_dta. load_memory returns 0 if the attempted move
  623.                        was successful, -1 if the attempted move failed.
  624.  
  625.         Function name: bytes_available
  626.         Prototype:     unsigned long bytes_available(void);
  627.  
  628.         Use:           bytes_available checks all memory types in use and
  629.                        returns the total amount of memory available to be
  630.                        allocated by alloc_mem.
  631.  
  632.         Function name: bytes_total
  633.         Prototype:     unsigned long bytes_total(void);
  634.  
  635.         Use:           bytes_total checks all memory types in use and returns
  636.                        the total amount of memory in those memory types. This is
  637.                        total system memory and is not the amount of memory that
  638.                        can be used.
  639.  
  640.         Function name: set_memory_usage
  641.         Prototype:     void set_memory_usage(int usage);
  642.  
  643.         Use:           set_memory_usage informs DVMAM of which types of memory
  644.                        you wish to attempt to use. By default DVMAM will attempt
  645.                        to use conventional, expanded and extended memory. There
  646.                        are four nyms associated with values that may be used to
  647.                        determine which memory types to use:
  648.  
  649.                        NONE     = 0
  650.                        USE_CONV = 1
  651.                        USE_EXT  = 2
  652.                        USE_EMS  = 4
  653.  
  654.         Examples:      set_memory_usage(USE_CONV);
  655.                        set_memory_usage(USE_EMS+USE_EXT);
  656.  
  657.  
  658.  
  659.  
  660.  
  661.  
  662.  
  663.  
  664.  
  665.  
  666.  
  667.                                        Page 8
  668.  
  669.         Examples continued..
  670.  
  671.                        set_memory_usage(USE_EXT+USE_CONV);
  672.                        set_memory_usage(NONE);
  673.  
  674.         Function name: memory_setup
  675.         Prototype:     void memory_setup(unsigned int size);
  676.  
  677.         Use:           memory_setup prepares extended memory structures, DVMAM
  678.                        structures and allocates memory to dvmam_dta. The amount
  679.                        to memory allocated to dvmam_dta is specified by size.
  680.  
  681.         Function name: memory_shutdown
  682.         Prototype:     void memory_shutdown(void);
  683.  
  684.         Use:           memory_shutdown frees all memory in use by DVMAM
  685.                        including dvmam_dta, extended, expanded and other
  686.                        conventional memory.
  687.  
  688.  
  689.                   How do I link the DVMAM library into my program?
  690.                   ------------------------------------------------
  691.  
  692.      TURBO C Projects
  693.      ----------------
  694.  
  695.           TURBO C projects take out a majority of the worry about linking the
  696.      DVMAM library into your program if you prefer to use the integrated
  697.      environment. To create a project for TURBO C, simply make a text file with
  698.      the files:
  699.  
  700.               DVMAMSTC.LIB
  701.               MYFILE.C
  702.  
  703.           MYFILE.C is the filename of your program. In many cases there will be
  704.      more files that make up the entire program than just the one specified by
  705.      MYFILE.C. These files also need to be added to the project list.
  706.  
  707.           Once the project file has been created the TURBO C environment needs
  708.      to know which project it is going to use to create the desired program.
  709.      Typing ALT-P to go to the project menu and entering the project name will
  710.      do this.
  711.  
  712.      TURBO C command-line compiler
  713.      -----------------------------
  714.  
  715.           If the environment is not used there are two other methods that may be
  716.      used to link the DVMAM library into your program. The first is by adding
  717.      the name DVMAMSTC.LIB to the list of command-line options with the TCC
  718.      command-line compiler. The second is using TLINK which should have come
  719.      with your TURBO C compiler.
  720.  
  721.  
  722.  
  723.  
  724.  
  725.  
  726.  
  727.  
  728.  
  729.  
  730.  
  731.  
  732.  
  733.                                        Page 9
  734.  
  735.           Using TCC is definitely the easier of the two methods as the default
  736.      libraries normally used with TURBO C are automatically included when TCC
  737.      attempts to link your file. This is a typical example of using TCC to
  738.      compile and link DVMAMSTC.LIB into your program
  739.  
  740.         C:>TCC MYFILE.C DVMAMSTC.LIB
  741.  
  742.           This simple example will compile MYFILE.C and attempt to link the
  743.      files MYFILE.OBJ (which is created by TCC) and DVMAMSTC.LIB with the
  744.      libraries that are normally used by TURBO C. It is important to make sure
  745.      that the memory model being used in MYFILE.C is the same as is used in
  746.      DVMAMSTC.LIB. The filename DVMAMSTC.LIB may be broken down as follows:
  747.      DVMAM S TC.LIB. The DVMAM naturally standing for DVMAM. S indicates small
  748.      memory model. For other memory models, C (compact), M (medium), L (large)
  749.      and H (huge) will be used. TC stands for TURBO C and the LIB indicates a
  750.      library file.
  751.  
  752.      TLINK
  753.      -----
  754.  
  755.           Attempting to link your program together by directly invoking TLINK is
  756.      definitely more difficult as ALL libraries must explicitly be specified. A
  757.      simplified example of using TLINK would be as follows:
  758.  
  759.         TLINK MYFILE,MEMORY,,DVMAMSTC
  760.  
  761.           TLINK will then attempt to link DVMAMSTC.LIB into the file MYFILE.OBJ
  762.      and create MEMORY.EXE. This would only work if no other functions other
  763.      than those in DVMAM which are written explicitly in assembler were to be
  764.      used (expanded and extended memory). Since DVMAM has been written both in
  765.      assembly and TURBO C many of the functions used in DVMAM use functions from
  766.      the standard TURBO C library. Those libraries may be specified on the
  767.      command line and linked in. A more complicated example would be:
  768.  
  769.         TLINK MYFILE C0S,MEMORY,,DVMAMSTC EMU CS MATHS
  770.  
  771.           TLINK would then attempt to link MYFILE.OBJ, C0S.OBJ, DVMAMSTC.LIB,
  772.      EMU.LIB, CS.LIB and MATHS.LIB together into an executable file called
  773.      MEMORY.EXE. It is critical that the file MYFILE is compiled and linked in
  774.      the same memory model as the libraries you intend to use. In the above
  775.      example CS.LIB, MATHS.LIB, DVMAMSTC.LIB and C0S.OBJ are all libraries that
  776.      use the small memory model.
  777.  
  778.  
  779.  
  780.  
  781.  
  782.  
  783.  
  784.  
  785.  
  786.  
  787.  
  788.  
  789.  
  790.  
  791.  
  792.  
  793.  
  794.  
  795.  
  796.  
  797.  
  798.  
  799.                                        Page 10
  800.  
  801.      Thanks
  802.      ------
  803.  
  804.           Thank you for your interest in the Dynamic-Virtual Memory Allocation
  805.      Manager. We'd love to hear from you with your comments on DVMAM and any
  806.      suggestions you may have as to how to improve DVMAM. We realize that
  807.      programs may float around for many months before they fall into your hands.
  808.      Feel free to write at any time for information about other products by
  809.      R.C.B. Enterprises or for information about what is happening in the
  810.      development of a specific program. If you discover that the version of
  811.      DVMAM you are using has been upgraded since you received your demo version
  812.      you may request a demo be sent out to you for a $3 charge to cover copying
  813.      and postage. Our address is:
  814.  
  815.                              R.C.B. Enterprises, Team A
  816.                                 15 Central Way, #287
  817.                                  Kirkland, WA. 98033
  818.  
  819.      Version 1.10 release
  820.      --------------------
  821.  
  822.           Version 1.10 is virtually the same as version 1.00. It contains one
  823.      bug fix performs two more checks than the previous version.
  824.  
  825.           The bug was in the deallocation of memory. Blocks deallocated were
  826.      deallocated, but not marked as so. So, depending on how much memory you
  827.      have in your machine, you would be able to allocate memory only a certain
  828.      number of times before you were unable to allocate. In the case of the main
  829.      testing computer with 2.2 megs, we were able to allocate 76 blocks before
  830.      all blocks were used. This bug is non-destructive and should not effect
  831.      users of version 1.0.
  832.  
  833.           There are two more checks performed. One is that you cannot allocate
  834.      more memory to a block than is allocated to dvmam_dta. So if you allocated
  835.      16k to dvmam_dta, you could not allocate a block that was 32k.
  836.  
  837.           The other check is on the boundaries in extended memory. It now floats
  838.      instead of staying in a stable position. This simply improves performance
  839.      of the extended memory engine.
  840.  
  841.  
  842.  
  843.  
  844.  
  845.  
  846.  
  847.  
  848.  
  849.  
  850.  
  851.  
  852.  
  853.                                        Page 11
  854.  
  855.  
  856.  
  857.  
  858.  
  859.  
  860.  
  861.  
  862.  
  863.  
  864.  
  865.                    Dynamic-Virtual Memory Allocation Manager 1.10
  866.                                   Registration Form
  867.  
  868.                    Thank you for taking the time to register DVMAM
  869.  
  870.      Company name:   _________________________________________
  871.  
  872.      User name:      _________________________________________
  873.  
  874.      Address:        _________________________________________
  875.  
  876.                      _________________________________________
  877.  
  878.      City,State,Zip: _________________________________________
  879.  
  880.      Phone:  (______) ______-_________ (in case there are questions about your
  881.                                         order)
  882.      Date of registration: ___________
  883.  
  884.      Compiler:  TURBO C [     ]  TURBO PASCAL [     ]  Microsoft C [     ]
  885.  
  886.      Compiler version: ______________
  887.  
  888.      I would like information about other products [     ]
  889.  
  890.      ==========================================================================
  891.  
  892.      Number of copies desired at $35 (U.S. currency) per copy _______
  893.  
  894.                                           $5 for shipping    $  5.00
  895.                    (Washington residents add 8.1% sales tax) $  _______
  896.  
  897.                                        Total amount enclosed $  _______
  898.  
  899.      Payment type:   ____ Money order/Cashiers check    ____ VISA
  900.  
  901.                      ____ Personal/Business check       ____ Master Card
  902.  
  903.         Please make checks payable to R.C.B. Enterprises. Personal and business
  904.      checks please allow at least 10 business days to clear.
  905.  
  906.  
  907.      Card number: ________________________ Signature: ________________________
  908.  
  909.      Expiration date: __________________
  910.  
  911.           Please send a copy of this registration form with registration payment
  912.      to:
  913.  
  914.                              R.C.B. Enterprises, Team A
  915.                                 15 Central Way, #287
  916.                                  Kirkland, WA. 98033
  917.  
  918.  
  919.  
  920.  
  921.  
  922.  
  923.  
  924.  
  925.